#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project : bigDataProject 
@File    : brand_info_enum.py
@IDE     : PyCharm 
@Author  : Mario
@Date    : 2022/11/14 18:19 
@Describe: 品牌信息枚举
"""
from enum import Enum, unique
from typing import List


@unique
class BRAND_INFO_ENUM(Enum):
    TAN_YU = ("823882", "5999")
    SA_JIAO = ("823883", "6999")
    CAILAN_PHO = ("823884", "8499")
    CAILAN_DIANXIN = ("823885", "8999")


def get_brand_code_list() -> List:
    """获取品牌编码列表"""
    brand_code_list = []
    for i in BRAND_INFO_ENUM:
        brand_code_list.append(i.value[0])
    return brand_code_list


if __name__ == '__main__':
    def brand_code_rule(brandCode):
        def is_valid(brand_code):
            if len(brand_code) != 6:
                return False
            if brand_code not in get_brand_code_list():
                return False
            return True

        if not is_valid(brandCode):
            raise ValueError("brandCode must be")


    brand_code_rule("823882")
